package com.woniuxy.amusementparkos.controller.lzw;

import com.woniuxy.amusementparkos.entity.lzw.ImprestSourceInfo;
import com.woniuxy.amusementparkos.util.lzw.result.ResponseResult;
import com.woniuxy.amusementparkos.service.lzw.ImprestSourceInfoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author lizhiwen
 * @create 2020-04-24 5:53 下午
 */
@RestController
@RequestMapping("imprestSourceInfo")
public class ImprestSourceInfoController {

    @Resource
    ImprestSourceInfoService imprestSourceInfoService;

    @GetMapping("selectAll")
    public ResponseResult<List<ImprestSourceInfo>> selectAllImprestSourceInfo(){
        ResponseResult<List<ImprestSourceInfo>> result = null;
        try{
            result = new ResponseResult<List<ImprestSourceInfo>>(200, "成功", imprestSourceInfoService.listAllByLimit(0, 10));
        }catch (Exception e){
            result = new ResponseResult<List<ImprestSourceInfo>>(501,e.getMessage(),null);
        }
        return result;
    }
}
